#!\bin\bash

# O executavel, é gerado na pasta bin/
mpicc -o rw_mpi rw_mpi.c src/genmtrand.c src/rw_functions.c src/rw_png.c -lm -lpng -std=c99 -O3 -Wall -fopenmp



for i in $(seq 1 10)
do
   mpiexec -n 1 rw_mpi 0 1024 2048 "$i" >> mpi/saida_1024_2048_MPI_1P
done


for i in $(seq 1 10)
do
    mpiexec -n 2 rw_mpi 0 1024 2048 "$i" >> mpi/saida_1024_2048_MPI_2P
done


for i in $(seq 1 10)
do
    mpiexec -n 4 rw_mpi 0 1024 2048 "$i" >> mpi/saida_1024_2048_MPI_4P
done


#for i in $(seq 1 10)
#do
#   mpiexec -n 1 rw_mpi 0 2048 4096 "$i" >> mpi/saida_2048_4096_MPI_1P
#done


#for i in $(seq 1 10)
#do
#    mpiexec -n 2 rw_mpi 0 2048 4096 "$i" >> mpi/saida_2048_4096_MPI_2P
#done


#for i in $(seq 1 10)
#do
#    mpiexec -n 4 rw_mpi 0 2048 4096 "$i" >> mpi/saida_2048_4096_MPI_4P
#done

#for i in $(seq 1 10)
#do
#   mpiexec -n 1 rw_mpi 0 4096 8192 "$i" >> mpi/saida_4096_8192_MPI_1P
#done


#for i in $(seq 1 10)
#do
#    mpiexec -n 2 rw_mpi 0 4096 8192 "$i" >> mpi/saida_4096_8192_MPI_2P
#done


#for i in $(seq 1 10)
#do
#    mpiexec -n 4 rw_mpi 0 4096 8192 "$i" >> mpi/saida_4096_8192_MPI_4P
#done
